package edu.hebeu.evil.freshmenguide.Activity;

import android.content.Context;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import edu.hebeu.evil.freshmenguide.R;
import edu.hebeu.evil.freshmenguide.Utils.Adapter.CommonAdapter;
import edu.hebeu.evil.freshmenguide.Utils.Adapter.ViewHolder;
import edu.hebeu.evil.freshmenguide.Utils.Utils;
import edu.hebeu.evil.freshmenguide.View.ScorllViewNextListView;

/********************************************
 * 工程名：FreshmenGuide
 * 包名：edu.hebeu.evil.freshmenguide.AboutActivity
 * 时间：16-7-18 下午3:11
 * 作者：白雨濃 evil
 * 邮箱：evilbai@foxmail.com
 * 内容：关于软件界面
 ********************************************/
public class AboutActivity extends BaseActivity
{
    private ImageView top_logo;
    private ListView listView;
    private ScorllViewNextListView scrollView;


    private Adapter adapter;
    private ArrayList<ItemBean> list;

    @Override
    public int setContentView()
    {
        return R.layout.about;
    }

    @Override
    public String setToolbarTitle()
    {
        return "关于软件";
    }

    @Override
    public void onCreate()
    {
        initView();/*初始化控件*/
        initTopLogo();/*初始化顶部logo*/
        setListView();/*设置ListView,简介信息*/
    }


    /**
     * 初始化控件
     */
    private void initView()
    {
        top_logo = (ImageView) findViewById(R.id.top_logo);
        listView = (ListView) findViewById(R.id.listView);
        //scrollView = (ScorllViewNextListView) findViewById(R.id.scrollView);
    }

    /**
     * 加载顶部logo
     */
    private void initTopLogo()
    {
        Utils.Glide(R.drawable.findviewbydream, top_logo);
    }

    /**
     * 设置简介信息
     */
    private void setListView()
    {
        list = new ArrayList<>();

        list.add(new ItemBean("河北工程大学信息与电气工程学院"));
        list.add(new ItemBean("新生入学指南"));
        list.add(new ItemBean(""));
        list.add(new ItemBean("指导教师:张强"));
        list.add(new ItemBean(""));
        list.add(new ItemBean("2014级 计算机科学与技术"));
        list.add(new ItemBean("移动开发组 制作"));
        list.add(new ItemBean(""));
        list.add(new ItemBean("开发者邮箱:"));
        list.add(new ItemBean("evilbai@foxmail.com"));

        adapter = new Adapter(this, list, R.layout.list_item);
        listView.setAdapter(adapter);
    }

    private class Adapter extends CommonAdapter<ItemBean>
    {

        public Adapter(Context context, List<ItemBean> itemBean_list, int itemLayoutResId)
        {
            super(context, itemBean_list, itemLayoutResId);
        }

        @Override
        public void convert(ViewHolder viewHolder, ItemBean item)
        {
            TextView textView=viewHolder.getView(R.id.textView);
            textView.setText(item.content);
            textView.setTextSize(15);
        }
    }

    private class ItemBean
    {
        public ItemBean(String content)
        {
            this.content = content;
        }

        String content;
    }


}
